#include<iostream>
#include"WorkerManager.h"
#include"employee.h"
#include"worker.h"
#include"manager.h"
#include"boss.h"

int main()
{
	int choice=0;
	WorkerManager wm;

	/*Worker* wk = NULL;
	wk = new Employee(1, "Jack", 2);
	wk->ShowId();
	delete wk;
	wk = new Manager(2, "Marry", 3);
	wk->ShowId();
	delete wk;
	wk = new Boss(3, "Jone", 3);
	wk->ShowId();
	delete wk;*/

	while (true)
	{
		wm.ShowMenu();
		std::cout << "请输入你的选择：";
		std::cin >> choice;
		switch (choice)
		{
		case 0:
			wm.ExitSystem();
			break;
		case 1:
			wm.Add_Emp();
			break;
		case 2:
			wm.Show_Emp();
			break;
		case 3:
		//{
		//	int ret = wm.IsExist(9);
		//	if (ret != -1)
		//	{
		//		std::cout << "该职工存在" << std::endl;
		//	}
		//	else
		//	{
		//		std::cout << "该职工不存在" << std::endl;
		//	}
		//}
		wm.Del_Emp();
			break;
		case 4:
			wm.Mod_Emp();
			break;
		case 5:
			wm.Find_Emp();
			break;
		case 6:
			wm.Sort_Emp();
			break;
		case 7:
			wm.CleanFile();
			break;
		default:
			//system("cls");
			break;
		}
	}
	std::cin.get();
	return 0;
}